﻿using Business.PubInfo;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class XwListForRcap : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!IsPostBack)
        {
            labBgclass3.Text = labBgclass1.Text = labBgclass2.Text = Request["extClassName"];
        }
    }

    public string GetLeftType()
    {
        string strReturn = string.Format("<li><a href='XwListForZx.aspx?extClassName={0}&sname='>{0}</a></li>", labBgclass1.Text);

        return strReturn;
    }

    public string GetXlHtml()
    {
        PubInfoManage pimTemp = new PubInfoManage();
        DataTable dtSource = new DataTable();
        string strReturn = string.Empty;

        if (labBgclass1.Text == "日程安排")
        {
            dtSource = pimTemp.GetEvents("");
            foreach (DataRow drTemp in dtSource.Rows)
            {
                strReturn += "<p><i></i>";
                strReturn += string.Format("<a href='Detail.aspx?lx=日程安排&art_id={3}' target='_blank'>{0}</a><span>[{1:yyyy-MM-dd}至{2:yyyy-MM-dd}]</span>", drTemp["title"], drTemp["dtstart"], drTemp["dtend"], drTemp["id"]);
                strReturn += " </p>";
            }
        }
        else if (labBgclass1.Text == "出差情况")
        {
            dtSource = pimTemp.GetCcqk();
            foreach (DataRow drTemp in dtSource.Rows)
            {
                strReturn += "<p><i></i>";
                strReturn += string.Format("<a href='Detail.aspx?lx=出差情况&art_id={3}' target='_blank'>{0}</a><span>[{1:yyyy-MM-dd}至{2:yyyy-MM-dd}]</span>", drTemp["xm"], drTemp["cckssj"], drTemp["ccjssj"], drTemp["id"]);
                strReturn += " </p>";
            }
        }
        
        labRecordCount.Text = dtSource.Rows.Count.ToString();
        return strReturn;
    }
}